package org.example.chat.entity;

import lombok.Data;
import org.hibernate.annotations.Comment;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author cheval
 */
@Data
@Entity
@Table(name = "chat_msg")
public class ChatMessage implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @Column(name = "id")
    private String id;

    @Column(name = "send_user_id", length = 64, nullable = false)
    @Comment("发送者id")
    private String sendUserId;

    @Column(name = "receive_user_id", length = 64, nullable = false)
    @Comment("接受者id")
    private String receiveUserId;

    @Column(name = "msg", length = 1000)
    @Comment("聊天消息")
    private String message;

    @Column(name = "sign_flag", length = 1, nullable = false)
    @Comment("是否签收 1: 已签收, 0: 未签收")
    private Integer signFlag;

    @Column(name = "create_time", nullable = false)
    @Comment("添加时间")
    private LocalDateTime createTime;
}
